GDK-Win32: Drop GDK_WIN32_ENABLE_EGL flag
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 7 Oct 2021 07:26:49 +0000 (15:26 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 8 Nov 2021 07:25:24 +0000 (15:25 +0800)
Instead, use HAVE_EGL check macro instead, which is used by the other
platforms as well.

gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkdisplay-win32.h
gdk/win32/gdkglcontext-win32.c
gdk/win32/gdkglcontext-win32.h
gdk/win32/gdksurface-win32.c
gdk/win32/gdksurface-win32.h
gdk/win32/meson.build

index 5495f0f6afdbd482611d76b0ffba653c4b5bf819..e89e35bb1461f18c15d8bea26c23d4afe454b07a 100644 (file)
@@ -38,7 +38,7 @@
 #include <dwmapi.h>
 
 #include "gdkwin32langnotification.h"
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
 # include <epoxy/egl.h>
 #endif
 
@@ -645,7 +645,7 @@ gdk_win32_display_dispose (GObject *object)
 {
   GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (object);
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   if (display_win32->egl_disp != EGL_NO_DISPLAY)
     {
       eglTerminate (display_win32->egl_disp);
@@ -1158,7 +1158,7 @@ gdk_win32_display_init_gl_backend (GdkDisplay  *display,
 
   result = gdk_win32_display_init_wgl (display, error);
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   if (!result)
     {
       g_clear_error (error);
@@ -1179,7 +1179,7 @@ gdk_win32_display_init_gl (GdkDisplay  *display,
   if (!gdk_win32_display_init_gl_backend (display, error))
     return NULL;
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   if (display_win32->egl_disp)
     gl_context = g_object_new (GDK_TYPE_WIN32_GL_CONTEXT_EGL, "display", display, NULL);
   else
@@ -1203,13 +1203,13 @@ gdk_win32_display_init_gl (GdkDisplay  *display,
 gpointer
 gdk_win32_display_get_egl_display (GdkDisplay *display)
 {
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   GdkWin32Display *display_win32;
 #endif
 
   g_return_val_if_fail (GDK_IS_WIN32_DISPLAY (display), NULL);
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   display_win32 = GDK_WIN32_DISPLAY (display);
 
   if (display_win32->wgl_pixel_format != 0)
index f9885e72e22efcfa318035ffddca9f172d18f5a4..d8d3d121e6fba6e92379c9bff15a2bbc6459baba 100644 (file)
@@ -25,7 +25,7 @@
 #include "gdkwin32screen.h"
 #include "gdkwin32cursor.h"
  
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
 # include <epoxy/egl.h>
 #endif
 
@@ -135,7 +135,7 @@ struct _GdkWin32Display
   int wgl_pixel_format;
   guint gl_version;
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   /* EGL (Angle) Items */
   guint egl_version;
   EGLDisplay egl_disp;
@@ -151,7 +151,7 @@ struct _GdkWin32Display
   guint hasWglARBPixelFormat : 1;
   guint hasWglARBmultisample : 1;
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   guint hasEglKHRCreateContext : 1;
   guint hasEglSurfacelessContext : 1;
   EGLint egl_min_swap_interval;
index ec5c51789fb38b374f3d8f70ce7aa7c1b999d097..c1126318ca8bc1f2617a6c2f2c04e1137ccf36ba 100644 (file)
@@ -40,7 +40,7 @@
 #include <cairo.h>
 #include <epoxy/wgl.h>
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
 # include <epoxy/egl.h>
 #endif
 
index 5bb122d16e57ef11fe4bb8b0ec3e95b12c0d0341..77995671cec8e3573452b79cc9aeae1399e4840b 100644 (file)
@@ -24,7 +24,7 @@
 #include <epoxy/gl.h>
 #include <epoxy/wgl.h>
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
 # include <epoxy/egl.h>
 #endif
 
index 2095402725c7531b47060c23c28e85eadbb078d9..760b8daddec25d9f535e2f46c2c898abf3e87375 100644 (file)
@@ -688,7 +688,7 @@ gdk_win32_surface_destroy (GdkSurface *window,
       gdk_win32_surface_set_transient_for (child, NULL);
     }
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_surface_get_display (window));
 
   /* Get rid of any EGLSurfaces that we might have created */
@@ -5053,7 +5053,7 @@ gdk_win32_drag_surface_iface_init (GdkDragSurfaceInterface *iface)
   iface->present = gdk_win32_drag_surface_present;
 }
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
 EGLSurface
 gdk_win32_surface_get_egl_surface (GdkSurface *surface,
                                    EGLConfig   config,
@@ -5170,7 +5170,7 @@ _gdk_win32_surface_invalidate_egl_framebuffer (GdkSurface *surface)
  *  as we need to re-acquire the EGL surfaces that we rendered to upload to Cairo explicitly,
  *  using gdk_window_invalidate_rect (), when we maximize or restore or use aerosnap
  */
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   if (surface->gl_paint_context != NULL && gdk_gl_context_get_use_es (surface->gl_paint_context))
     {
       GdkWin32Surface *impl = GDK_WIN32_SURFACE (surface);
index fb2ab6456db04ff55a2690951c241c17a673b57d..53ee521117d6f26b1a36afa9a05be728691d6cb1 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <windows.h>
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
 # include <epoxy/egl.h>
 #endif
 
@@ -338,7 +338,7 @@ struct _GdkWin32Surface
     RECT configured_rect;
   } next_layout;
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
   EGLSurface egl_surface;
   EGLSurface egl_dummy_surface;
   guint egl_force_redraw_all : 1;
@@ -373,7 +373,7 @@ void gdk_win32_surface_move_resize (GdkSurface *window,
 RECT
 gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context);
 
-#ifdef GDK_WIN32_ENABLE_EGL
+#ifdef HAVE_EGL
 EGLSurface gdk_win32_surface_get_egl_surface (GdkSurface *surface,
                                               EGLConfig   config,
                                               gboolean    is_dummy);
index 0177adaf838a2ca25ae6339bc23bf392b0fc34e9..0f40e73edcb6fb31dd8e35d89ba111975de97e69 100644 (file)
@@ -46,10 +46,7 @@ gdk_win32_public_headers = files([
 
 install_headers(gdk_win32_public_headers, 'gdkwin32.h', subdir: 'gtk-4.0/gdk/win32/')
 
-GDK_WIN32_EGL_CFLAGS = []
-
 if have_egl
-  GDK_WIN32_EGL_CFLAGS = ['-DGDK_WIN32_ENABLE_EGL']
   gdk_win32_sources += ['gdkglcontext-win32-egl.c']
 endif
 
@@ -67,6 +64,6 @@ libgdk_win32 = static_library('gdk-win32',
     '-DINSIDE_GDK_WIN32',
     '-D_WIN32_WINNT=0x0601',
     '-DWINVER=0x0601',
-  ] + GDK_WIN32_EGL_CFLAGS,
+  ],
   dependencies: [ gdk_deps, gdk_win32_deps ],
 )